import _fetch from '../utils/request'

// 调用接口获取到验证码

function apiGetCode (mobile) {
  return _fetch({
    url: '/au/code',
    method: 'post',
    data: {
      mobile: mobile
    }
  })
}

// 登录信息
function apiLogin ({ mobile, code }) {
  return _fetch({
    url: '/au/login',
    method: 'post',
    data: {
      mobile,
      code
    }
  })
}

// 鉴定用户信息
function apiInfo () {
  return _fetch({
    url: '/au/info',
    headers: {
      authorization:
        'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiaWF0IjoxNjAxMDM2NjYwLCJleHAiOjE2MDM2Mjg2NjB9.aBIgO_PzIRtPdlg8RE1KqCTbgq6TD0PbCdq01WBdbxQ'
    }
  })
}

export { apiGetCode, apiLogin, apiInfo }
